-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(LT-5508): orders and positions are fixed during state validation #526
base: master
Are you sure you want to change the base?
Conversation
gponomarev-lykke
commented
May 28, 2024
- orders and positions are fixed during state validation
- the fixed values are then used to create a draft snapshot
- a retry policy added so the "trading data snapshot might be corrupted" fatal errors should be less frequent
- orders and positions are fixed during state validation - the fixed values are then used to create a draft snapshot - a retry policy added so the "trading data snapshot might be corrupted" fatal errors should be less frequent
|
||
namespace MarginTrading.Backend.Core.Orders | ||
{ | ||
public interface IOrderReader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a dedicated interface for InMemorySnapshot?
Something like IOrderReader: IOrderReaderBase, where IOrderReaderBase has only 2 required methods?
{ | ||
var ex = new InvalidOperationException( | ||
$"The trading data snapshot might be corrupted. The current state of orders and positions is incorrect. Check the dbo.BlobData table for more info: container {LykkeConstants.MtCoreSnapshotBlobContainer}, correlationId {correlationId}"); | ||
await _log.WriteFatalErrorAsync(nameof(SnapshotService), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of not valid result we still will have a fatal error I think. Ant this will happen on every retry. Is that expected? And if yes, why?
"The current state of orders and positions is correct."); | ||
} | ||
|
||
return validationResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also SnapshotStateValidationPolicy will retry on exceprion, but this method will not throw an exception.